testsuite: Fix potential strcmp() against NULL
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 20 Nov 2013 17:39:21 +0000 (17:39 +0000)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Sun, 24 Nov 2013 21:21:46 +0000 (21:21 +0000)
Use g_strcmp0() instead.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760

testsuite/gtk/object.c

index 1bfd1bfe53da8bf794062abc3cc8244e1ff08d34..055fc3a864011c2acfdc89f100bf7ea1b26a4c52 100644 (file)
@@ -225,7 +225,7 @@ object_test_property (GObject           *object,
              (MATCH_ANY_VALUE == ignore_properties[i].value ||
               value_as_pointer (&value) == ignore_properties[i].value ||
               (G_VALUE_HOLDS_STRING (&value) &&
-               strcmp (g_value_get_string (&value), ignore_properties[i].value) == 0))))
+               g_strcmp0 (g_value_get_string (&value), ignore_properties[i].value) == 0))))
           break;
       /* ignore known property bugs if not testing thoroughly */
       if (ignore_properties[i].name == NULL && !g_test_thorough ())
@@ -237,7 +237,7 @@ object_test_property (GObject           *object,
                 (MATCH_ANY_VALUE == ignore_properties[i].value ||
                  value_as_pointer (&value) == ignore_properties[i].value ||
                  (G_VALUE_HOLDS_STRING (&value) &&
-                  strcmp (g_value_get_string (&value), ignore_properties[i].value) == 0)))
+                  g_strcmp0 (g_value_get_string (&value), ignore_properties[i].value) == 0)))
               break;
         }
       /* assign unignored properties */